package com.github.chirspan.xaas.core.rest;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * *******description*******
 * Rest错误码
 * *************************
 *
 * @author chenpan
 * @date 2020/5/6 17:40
 */
@AllArgsConstructor
public enum RestResultStatus {

    OK(200, "OK"),
    HTTP_ERROR_100(100, "1XX错误"),
    HTTP_ERROR_300(300, "3XX错误"),
    HTTP_ERROR_400(400, "4XX错误"),
    HTTP_ERROR_500(500, "5XX错误"),
    SIGN_ERROR(120, "签名错误"),
    TIME_OUT(130, "访问超时"),
    KICK_OUT(300, "您已经在其他地方登录，请重新登录！"),
    BAD_REQUEST(407, "参数解析失败"),
    INVALID_TOKEN(401, "无效的授权码"),
    INVALID_CLIENTID(402, "无效的密钥"),
    FORBIDDEN(403, "无权限访问"),
    REQUEST_NOT_FOUND(404, "访问地址不存在！"),
    METHOD_NOT_ALLOWED(405, "不支持当前请求方法"),
    REPEAT_REQUEST_NOT_ALLOWED(406, "请求重复提交"),
    SYSTEM_ERR(500, "服务器运行异常"),
    UNSUPPORTED_GRANT_TYPE(10000,"无效授权类型"),
    USER_OR_ERROR_PWD(10002,"用户名或密码错误"),
    NOT_EXIST_USER(10003, "用户不存在"),
    CLIENT_NOT_EXISIT(10004,"客户端不存在"),
    CLIENT_ERROR(10005,"客户端信息错误"),
    NOT_PARAM_USER_OR_ERROR_PWD(10006, "用户名或密码为空"),
    UNAUTH_ERROR(10007, "您没有该权限"),
    LOST_TOKEN(10008, "缺少授权码"),
    CHECK_TOKEN_ERROR(10009, "授权码校验失败"),
    EXPIRED_TOKEN(10010, "授权码过期"),
    REDIS_ERROR(1101, "redis异常"),
    REDIS_CONNECT_ERROR(1102, "redis连接异常"),
    DB_ERROR(1103, "数据库异常"),
    BUSINESS_ERROR(20000,"业务异常"),
    NULL_FILE(20010, "文件为空");

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String msg;
}
